﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Admin/Views/Layouts/Administration.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<FacialClub.Models.Entities.Customer>>" %>
<%@ Import Namespace="FacialClub.Helpers" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Index
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Index</h2>

    <table>
        <tr>
            <th>
                Name
            </th>
            <th>
                Address
            </th>
            <th>
                City
            </th>
            <th>
                State
            </th>
            <th>
                PostalCode
            </th>
            <th>
                Country
            </th>
            <th>
                Email
            </th>
            <th>
                IsActive
            </th>
            <th>
                CreatedDate
            </th>
            <th>Actions</th>
        </tr>

    <% foreach (var item in Model) { %>
    
        <tr>
            <td>
                <%: Html.ActionLink(item.FirstName+" "+item.LastName, "Details", new { id = item.CustomerId })%>
                
            </td>
            <td>
                <%: item.Address %>
            </td>
            <td>
                <%: item.City %>
            </td>
            <td>
                <%: item.State %>
            </td>
            <td>
                <%: item.PostalCode %>
            </td>
            <td>
                <%: item.Country %>
            </td>
            <td>
                <%: item.Email %>
            </td>
            <td>
                <%: item.IsActive %>
            </td>
            <td>
                <%: String.Format("{0:g}", item.CreatedDate) %>
            </td>
            <td>
                <table>
                <tr>
                <td><%: Html.CustomActionLink("Edit", "Customer", new { id = item.CustomerId }, "/Content/images/edit_icon.png","Edit")%></td>
                <td><%: Html.CustomActionLink("Delete", "Customer", new { id = item.CustomerId }, "/Content/images/delete_icon.png", "Delete")%></td>
                </tr>
                </table>
            </td>
        </tr>
    
    <% } %>

    </table>

    <p>
        <%: Html.ActionLink("Create New", "Create") %>
    </p>

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>

